<template>
	<view>
		<view class="" style="height:70px;"></view>
		<foo-bar @toIndex="toIndex" :home="3"></foo-bar>
	</view>
</template>

<script>
	import fooBar from '@/components/fooBar/fooBar.vue'
	export default {
		components: {
			fooBar
		},
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {
			uni.hideTabBar()
		},
		methods: {
			toIndex(index) {
				let that = this
				that.index = index
				if (index == 0) {
					uni.switchTab({
						url: '/pages/index/index'
					})
				} else if (index == 1) {
					uni.switchTab({
						url: '/pages/center/center'
					})
				} else if (index == 2) {
					uni.switchTab({
						url: '/pages/list/list'
					})
				} else if (index == 3) {
					uni.switchTab({
						url: '/pages/user/user'
					})
				} else if (index == 4) {
					if (!that.vuex_user) {
						that.loginShow = true
						return
					}
					that.goToWrite()
				}
			}
		}
	}
</script>

<style>

</style>
